/**************************************************************************
 * @doc PROTOCOL
 * @module PROTFUNC.H | Header file for Protocol table functions
 *
 * Product     :   SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   :   SoftPay Development Team (I_SP2000).
 * <nl>Notes       :
 *
 * @head3 PROTOCOL Functions |
 * @index | PROTOCOL
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 *
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form
 * or by any means whether electronic, mechanical, magnetic, optical,
 * or otherwise, without the express prior written permission of VeriFone, Inc.
 *
 * Revision History
 * ------------------------------------------------------------------------
 $Log: /SoftPay/SPK2SIM/Source/Protocol/protfunc.h $
 ********************************************************************************/
#ifndef PROTFUNC_H
#define PROTFUNC_H

#include <packet.h>
#include <protocol.h>

#define STX_ETX_LRC				1
#define STX_ETB_LRC				2
#define SI_SO_LRC				3
#define STX_DL_ETX_LRC			4
#define SOH_ETX_LRC				5

/* Frame Types */
#define STX_ETX_LRC				1
#define STX_ETB_LRC				2
#define SI_SO_LRC				3
#define STX_DL_ETX_LRC			4
#define SOH_ETX_LRC				5

/* Charatcers */
#define NUL 		0x00
#define SOH 		0x01
#define STX 		0x02
#define ETX 		0x03
#define EOT 		0x04
#define ENQ 		0x05
#define ACK 		0x06
#define BEL 		0x07
#define BS 			0x08
#define DLE 		0x10
#define DC1 		0x11
#define NAK 		0x15
#define SYN 		0x16
#define ETB 		0x17
#define CAN 		0x18
#define ESC 		0x1B
#define FS 			0x1C
#define US 			0x1F
#define SPACE 		0x20
#define FORMFEED 	0x0C
#define CR 			0x0D
#define LF 			0x0A
#define ANY         0xFF
#define PAD 		0x0FF

//extern int inAddProtocolFunctions(void);
int inAddProtocolFunctions(void);
int inSetProtoError (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inReceiveAnyChar (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inCheckPacketLRC (PROTOCOL_OBJECT *pobProtocol,  PACKET_OBJECT *pobPacket);
int inReceiveChar (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inReceivePacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inReceiveHotelLanPacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inSendAChar (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inMakePacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inFramePacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inDeFramePacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inSendPacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inResetCounter (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inIncrementCounter (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inBranchOnChar (PROTOCOL_OBJECT *pobProtocol,  PACKET_OBJECT *pobPacket);
int inResetRecordNumber (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inIncrementRecordNumber (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inTestRecordNumber (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inEndofBatch (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inDismantlePacket(PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inClearRecvBuff(PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inPause (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inEndOfDownload (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inAnalysePacket (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inTimeOutReceiveAnyChar (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inGiveErrorReceiveAnyChar (PROTOCOL_OBJECT *pobProtocol,  PACKET_OBJECT *pobPacket);
int inReceivePacketWithDisconnect (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inSkipRecord (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inWaitDelay (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inSetRetry (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inResetRetry (PROTOCOL_OBJECT *pobProtocol, PACKET_OBJECT *pobPacket);
int inSetContinueFlag (PROTOCOL_OBJECT *obProtocol, PACKET_OBJECT *obPacket);
int inEndCounterRecords (PROTOCOL_OBJECT *obProtocol, PACKET_OBJECT *obPacket);

#endif
